How using «git archive» in CICD gitlab

您所在的位置:网站首页 with gitlab pages and cicd how do you build How using «git archive» in CICD gitlab

How using «git archive» in CICD gitlab

2023-04-24 01:53| 来源: 网络整理| 查看: 265

Hello, I am setting up a blog with gitlab-pages using Pelican. At first I managed to deploy and access a first version that used a theme hosted on github. But now I would like to use a custom theme hosted on Gitlab repository.

I used the same method of github recommended in the gitlab.ci

- svn export https://github.com/getpelican/pelican-themes/trunk/ /tmp/ - pelican-themes --install /tmp/the_theme

But gitlab does not support the “svn export” command. The similar command with git is “git archive” which is supported by gitlab but only in SSH version (not HTTPS). So I try to do

- mkdir /tmp/ - ssh -o StrictHostKeyChecking=no [email protected] uptime - git archive --prefix=/tmp// [email protected]:/.git HEAD

But here I have the error message “Permission denied (publickey)”. Normal since I didn’t put a keys of a gitlab account in parameter.

So I have to use “git clone”.

- git clone https://gitlab.com//.git /tmp/ - rm -rf /tmp//.git

What bothers me is to download and delete the “.git” directory which is useless in my case. The command “git archive” avoids this but I don’t know how to do it without SSH keys from a gitlab account.

Do you have an idea? Is there a cleaner solution? Thanks in advance



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3